<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<sec:authentication property="principal" var="currentPrincipal" scope="page"/>

<fmt:setBundle basename="ApplicationMessage"/>
<fmt:setLocale value="zh_CN"/>

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp" %>
  <%@ include file="/WEB-INF/include/css.jsp" %>

</head>

<body class="ms-theme-blue">

	<%@ include file="/WEB-INF/include/header.jsp" %>
	<%@ include file="/WEB-INF/include/submenu.jsp" %>
	
	<div class="container-fluid ms-container has-ms-sidemenu">
	
	  <ol class="ms-breadcrumb breadcrumb">
	    
      <c:choose>
        <c:when test="${trailerMenuType eq 'editing'}">
          <li class="active">挂车信息审核</li>
        </c:when>
        <c:when test="${trailerMenuType eq 'qualified'}">
          <li class="active">挂车信息查询</li>
        </c:when>
        <c:otherwise>
          <li class="active">挂车信息管理</li>
        </c:otherwise>
      </c:choose>
      
      <a href="javascript:window.history.back();" class="pull-right" style="margin-right: 10px;">
        <span class="glyphicon glyphicon-arrow-left"></span>&nbsp;返回
      </a>
      
	  </ol>
	
	  <div class="ms-content-layout">
	
      <c:set var="status" value="${trailer.status}"/>
      
		  <div class="block-heading">
		    <h5>挂车基本信息</h5>
		    <c:if test="${trailerMenuType == 'self' and !trailer.vam and (status.editing or (status.rejected and trailer.declareStatus.unsync) or status.qualified)}">
			    <a href="${ctx.host}/trailers/${trailer.id}/edit-info" data-target="#edit-info" data-toggle="modal" class="pull-right" style="font-size: 12px; padding-top: 20px;">编辑</a>
		    </c:if>
		  </div>
		
		  <div class="form-horizontal ms-form form-personal-info">
		
		    <div class="form-group ms-form-group">
			    <label class="control-label col-xs-3 ">1&nbsp;<span class="color-red">*</span>运输公司：</label>
			    <div class="col-xs-3 pull-left">
			      <p class="form-control-static">${trailer.supplier.name}</p>
			    </div>
			
			    <label class="control-label col-xs-2 ">2&nbsp;<span class="color-red">*</span>产证所有者：</label>
			    <div class="col-xs-3 pull-left">
			      <p class="form-control-static">${trailer.floorLord}</p>
			    </div>
		    </div>
		    
		    <div class="form-group ms-form-group">
			    <label class="control-label col-xs-3 ">3&nbsp;<span class="color-red">*</span>挂车类型：</label>
			    <div class="col-xs-3 pull-left">
			      <p class="form-control-static">${trailer.trailerType.description}</p>
			    </div>
			
			    <label class="control-label col-xs-2 ">4&nbsp;<span class="color-red">*</span>中文车牌号：</label>
			    <div class="col-xs-3 pull-left">
			      <p class="form-control-static">${trailer.brandCNCode}</p>
			    </div>
		    </div>
		    
		    <div class="form-group ms-form-group">
			    <label class="control-label col-xs-3 ">5&nbsp;<span class="color-red">*</span>车辆审核状态：</label>
			    <div class="col-xs-3 pull-left">
			      <p class="form-control-static">${status.description}</p>
			    </div>
			
			    <label class="control-label col-xs-2 ">6&nbsp;<span class="color-red">*</span>VIN码：</label>
			    <div class="col-xs-3 pull-left">
			      <p class="form-control-static">${trailer.vincode}</p>
			    </div>
		    </div>
      
        <div class="form-group  ms-form-group">
          <label class="control-label col-xs-3">7&nbsp;<span class="color-red">*</span>实际长*宽*高：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${trailer.length}&nbsp;*&nbsp;${trailer.width}&nbsp;*&nbsp;${trailer.height}</p>
          </div>
          
          <label class="control-label col-xs-2">8&nbsp;<span class="color-red">*</span>装载量：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${trailer.trainload}</p>
          </div>
        </div>
    
        <div class="form-group  ms-form-group">
          <label class="control-label col-xs-3">9&nbsp;<span class="color-red">*</span>年检有效期至：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">
              <fmt:formatDate value="${trailer.annualInspectionDate}" pattern="yyyy-MM"/>
            </p>
          </div>
          
          <label class="control-label col-xs-2">10&nbsp;<span class="color-red">*</span>轴数：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${trailer.axles}</p>
          </div>
        </div>
    
        <div class="form-group  ms-form-group">
          <label class="control-label col-xs-3">11&nbsp;<span class="color-red">*</span>车辆类型（行驶证）：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${trailer.vehicleType.description}</p>
          </div>
          
          <label class="control-label col-xs-2">12&nbsp;<span class="color-red">*</span>品牌：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${trailer.brand}</p>
          </div>  
        </div>
        
        <c:if test="${trailer.vam}">
          <div class="form-group  ms-form-group">
            <label class="control-label col-xs-3">13&nbsp;<span class="color-red">*</span>资产状态：</label>
            <div class="col-xs-3 pull-left">
              <p class="form-control-static">${trailer.assetStatus.description}</p>
            </div>
          </div>
        </c:if>
    
        <div class="form-group  ms-form-group">  
          <label class="control-label col-xs-3">14&nbsp;<span class="color-red">*</span>行驶证原件扫描件：</label>
          <div class="col-xs-3 pull-left">
            <c:choose>
              <c:when test="${not empty trailer.drivingLicense}">
                <p class="form-control-static">
                  <a href="javascript:void(0);" class="btn view-img-btn ms-btn btn-default big-close-up" data-imgsrc="${trailer.drivingLicense}">查看图片</a>
                  <c:if test="${trailerMenuType == 'self' and (status.editing or status.rejected) and !trailer.vam}">
                    <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/trailers/${trailer.id}/cover?type=drivingLicense&fileObject=Trailer&objectId=${trailer.id}&modal=true&acceptType=image" data-target="#upload" data-toggle="modal">重新上传</a>
                  </c:if>
                </p>
              </c:when>
              <c:otherwise>
                <c:choose>
                  <c:when test="${trailerMenuType == 'self' and (status.editing or status.rejected) and !trailer.vam}">
                    <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/trailers/${trailer.id}/cover?type=drivingLicense&fileObject=Trailer&objectId=${trailer.id}&modal=true&acceptType=image" data-target="#upload" data-toggle="modal">行驶证原件扫描件</a>
                  </c:when>
                  <c:otherwise>
                    <p class="btn ms-btn btn-warning" style="padding: 1px 5px;">暂无相关文件</p>
                  </c:otherwise>
                </c:choose>
              </c:otherwise>
            </c:choose>
          </div>
        
          <label class="control-label col-xs-2">15&nbsp;<span class="color-red">*</span>行驶证副本及检验页扫描件：</label>
          <div class="col-xs-3 pull-left">
            <c:choose>
              <c:when test="${not empty trailer.drivingLicenseCopy}">
                <p class="form-control-static">
                  <a href="javascript:void(0);" class="btn view-img-btn ms-btn btn-default big-close-up" data-imgsrc="${trailer.drivingLicenseCopy}">查看图片</a>
                  <c:if test="${trailerMenuType == 'self' and (status.editing or status.rejected) and !trailer.vam}">
                    <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/trailers/${trailer.id}/cover?type=drivingLicenseCopy&fileObject=Trailer&objectId=${trailer.id}&modal=true&acceptType=image" data-target="#upload" data-toggle="modal">重新上传</a>
                  </c:if>
                </p>
              </c:when>
              <c:otherwise>
                <c:choose>
                  <c:when test="${trailerMenuType == 'self' and (status.editing or status.rejected) and !trailer.vam}">
                    <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/trailers/${trailer.id}/cover?type=drivingLicenseCopy&fileObject=Trailer&objectId=${trailer.id}&modal=true&acceptType=image" data-target="#upload" data-toggle="modal">行驶证副本及检验页扫描件</a>
                  </c:when>
                  <c:otherwise>
                    <p class="btn ms-btn btn-warning" style="padding: 1px 5px;">暂无相关文件</p>
                  </c:otherwise>
                </c:choose>
              </c:otherwise>
            </c:choose>
          </div>
        </div>
        
        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">16&nbsp;<span class="color-red">*</span>45度角照片：</label>
          <div class="col-xs-3 pull-left">
            <c:choose>
              <c:when test="${not empty trailer.vehiclePhoto}">
                <p class="form-control-static">
                  <a href="javascript:void(0);" class="btn view-img-btn ms-btn btn-default big-close-up" data-imgsrc="${trailer.vehiclePhoto}">查看图片</a>
                  <c:if test="${trailerMenuType == 'self' and (status.editing or status.rejected) and !trailer.vam}">
                    <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/trailers/${trailer.id}/cover?type=vehiclePhoto&fileObject=Trailer&objectId=${trailer.id}&modal=true&acceptType=image" data-target="#upload" data-toggle="modal">重新上传</a>
                  </c:if>
                </p>
              </c:when>
              <c:otherwise>
                <c:choose>
                  <c:when test="${trailerMenuType == 'self' and (status.editing or status.rejected) and !trailer.vam}">
                    <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/trailers/${trailer.id}/cover?type=vehiclePhoto&fileObject=Trailer&objectId=${trailer.id}&modal=true&acceptType=image" data-target="#upload" data-toggle="modal">45度角照片</a>
                  </c:when>
                  <c:otherwise>
                    <p class="btn ms-btn btn-warning" style="padding: 1px 5px;">暂无相关文件</p>
                  </c:otherwise>
                </c:choose>
              </c:otherwise>
            </c:choose>
          </div>
        </div>
        
      </div>
		    
    </div>
	</div>
	
	<%@ include file="/WEB-INF/include/script.jsp" %>
	<d:resource type="script" root="${ctx.resource}/build" src="js/page/supplier/management/trailer/trailer-profile-view.js"/>
  <script type="text/javascript">
    require(['page/supplier/management/trailer/trailer-profile-view'], function (page) {
      page.init({
	      'brandCNCode': '${trailer.brandCNCode}'
	    })
    })
  </script>

</body>
</html>